<!DOCTYPE html>
<html>
	
	<head>
		<meta charset="utf-8">

		<!-- !Always force latest IE rendering engine (even in intranet) & Chrome Frame

		Remove this if you use the .htaccess -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<title>07_JavaScript_window</title>
		<meta name="description" content="">
		<meta name="author" content="chenyong">

		<meta name="viewport" content="width=device-width; initial-scale=1.0">
 
		<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
		<link rel="shortcut icon" href="/favicon.ico">
		<link rel="apple-touch-icon" href="/apple-touch-icon.png">
		
		<style type="text/css">
			
			
			body{
				margin:50px;
			}
			
			div{
				font-size:12px;
			}
			
			div.box{
				margin-top:30px;
			}
		
			
		</style>
		
		<script type="text/javascript">
		
		var cldWindow;
		
		function fn1(){
			cldWindow = window.open('js07_windows2.html','_blank','toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400');
			return cldWindow;
		}
		
		function fn2(){
			cldWindow.document.getElementById('cldp').innerHTML='通过父窗口访问子窗口，并更改内容';
		}
		</script>
	</head>
	
	<body>
		
			
		<h3>07_JavaScript_window</h3>
		
		<div class="box" >
			<p><b>打开子窗口</b></p>
			<p>通过window.open(URL,name,features,replace)打开新的窗口，新的窗口和当前窗口存在父子关系</p>
			<button onclick="fn1()" style="cursor: pointer">点击打开子窗口</button>
			<button onclick="fn2()" style="cursor: pointer">点击修改子页面内容</button>
			<p id="comment"> </p>
		</div>
		
 		
	
	
	</body>
	
</html>
